package com.uzai.console.dto.turnlink;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 转链联盟配置对象
 *
 * @author mingyang.chen create in 2022/11/3 15:18
 */
@ApiModel("转链联盟配置对象")
@Data
public class TurnLinkLeagueSettingDto {

    @ApiModelProperty("主键ID, 有值更新, 没值新增")
    private Long id;

    /**
     * 平台
     */
    @ApiModelProperty("平台. 0: 淘宝, 1: 京东, 2: 拼多多, 3: 唯品会, 11: 抖音")
    private Integer platform;

    @ApiModelProperty("关联的联盟账号")
    private List<TurnLinkLeagueSettingAccount> relAccounts;

    @ApiModelProperty("扩展json")
    private JSONObject ext;

    @ApiModel("转链联盟配置关联账号对象")
    @Data
    public static class TurnLinkLeagueSettingAccount {

        @ApiModelProperty("ID主键")
        public Long id;

        @ApiModelProperty("关联联盟账号类型. 0: 拼多多/快手(多多进宝账号), 抖音(自营大人账号), 1: 拼多多/快手(退老板账号), 抖音(官方共享账号)")
        private Integer accountType;

        @ApiModelProperty("推广位配置")
        public List<TurnLinkPromotion> promotion;

        @ApiModelProperty("联盟账号ID")
        private Long accountId;
    }

    @Data
    @ApiModel("转链联盟推广位对象")
    public static class TurnLinkPromotion {

        @ApiModelProperty("pid")
        public String pid;

        @ApiModelProperty("备注")
        public String remark;

        @ApiModelProperty("是否时默认pid, 0: 不是, 1: 是, 淘宝平台使用")
        private Integer defPid;
    }
}
